#region Summary

// 
// Owner : JackieHan 
// 
// Solution : LearnSolution 
// 
// Project : TestResourceSetting 
// 
// File : TestEnum.cs 
// 
// CopyRight : Copyright © 2009-2010 JackieHan Personal, All Rights Reserved 
// 
// Summary : 测试按位与 
// 
// History : 
//			2010-05-18 15:08:14	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using NUnit.Framework;

#endregion

namespace TestResourceSetting
{
    /// <summary> 
    /// 测试按位与 
    /// </summary> 
    [TestFixture]
    public class TestEnum
    {
        [Test]
        public void Test()
        {
            ResourceEnum val = ResourceEnum.AddAgent | ResourceEnum.AddMajordomo
                                     | ResourceEnum.DeleteAgent | ResourceEnum.DeleteMajordomo
                                     | ResourceEnum.UpdateAgent | ResourceEnum.UpdateMajordomo;
            Assert.AreEqual((int)(val), 63);

            Assert.AreNotEqual(ResourceEnum.AddAgent & val, ResourceEnum.Zero);

            var val1 = ResourceEnum.AddMember & val;
            Assert.AreEqual(val1, ResourceEnum.Zero);
        }
    }
}
